IF exists(SELECT * FROM dbo.sysobjects WHERE name='geefEindDatumEG' AND xtype='P') 
BEGIN
	DROP PROCEDURE geefEindDatumEG
END
GO

create procedure geefEindDatumEG
(@jaar varchar(4),
 @datum datetime)
as
update alleGestarteLln
set verlatenEGOp = @datum
select * from alleGestarteLln 
where left(stamNrEG,2)= left(@jaar,2)